<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/pages/common/easyui.jsp"%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="${context_path}/script/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
<script language="JavaScript" src="${context_path}/script/ztree/jquery.ztree.core-3.5.min.js"></script>
<script language="JavaScript" src="${context_path}/script/common.js"></script>
<title></title>
<SCRIPT type="text/javascript" >
  <!--
    //获取菜单树
	var zTree;
	var demoIframe;
	
	//初始化设置
	var setting = {
		view: {
			dblClickExpand: false,
			showLine: true,
			selectedMulti: false
		},
		data: {
			simpleData: {
				enable:true,
				idKey: "id",
				pIdKey: "pId",
				rootPId: ""
			}
		},
		callback: {
			onClick: function (event, treeId, treeNode, clickFlag) {
				//创建新的Tab页
				createTab(treeNode.name,treeNode.path,'tabs');
			}	
		}
	};

	$(document).ready(function(){
		var t = $("#tree");
		//需要动态菜单JSON数组，拼接树
		var zNodes =${menuJson};
		t = $.fn.zTree.init(t, setting, zNodes);
		var zTree = $.fn.zTree.getZTreeObj("tree");
		zTree.selectNode(zTree.getNodeByParam("id", 2));
	});
	

	function loadReady() {
		var bodyH = demoIframe.contents().find("body").get(0).scrollHeight,
		htmlH = demoIframe.contents().find("html").get(0).scrollHeight,
		maxH = Math.max(bodyH, htmlH), minH = Math.min(bodyH, htmlH),
		h = demoIframe.height() >= maxH ? minH:maxH ;
		if (h < 530) h = 530;
		demoIframe.height(h);
	}

  //-->
  </SCRIPT>
</head>
<body scroll="no">
	<div class="easyui-layout" style="width:100%;height:100%;">
		<div data-options="region:'north'" style="height:80px"></div>
		<div data-options="region:'south',split:true" style="height:30px;"></div>
		<!-- 菜单 -->
		<div data-options="region:'west',split:true,iconCls:'icon-ok'" title="菜单" style="width:200px;">
			  <ul id="tree" class="ztree" style="width:180px;"></ul>
		</div>
		<!-- 主操作界面 -->
		<div data-options="region:'center',border:false">
			<div id="tabs" class="easyui-tabs">
				<div title="Welcome" style="padding:0px"></div>
			</div>
		</div>
	</div>
</body>
</html>